package com.example.emb.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.emb.entity.Showworktable;
import com.example.emb.mapper.ShowworktableMapper;
import com.example.emb.service.GreatWorkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class GreatWorkServiceImpl implements GreatWorkService {
    @Autowired
    ShowworktableMapper showworktableMapper;

    @Override
    public List<Showworktable> GetSelectedGreatWork(int year, int classType) {
        List<Showworktable> list=new ArrayList<>();
        QueryWrapper<Showworktable> queryWrapper=new QueryWrapper<>();
        if(classType!=-1){
            queryWrapper.eq("classType",classType);
        }
        if(year!=0)
            queryWrapper.eq("modifiedTime",year);
        list=showworktableMapper.selectList(queryWrapper);
        return list;
    }
}
